package pl.SilverSable.Engine.tools;

import pl.SilverSable.Engine.AssetConsole;
import pl.SilverSable.Engine.physic.SimpleVector2;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class FPSViewer {

	BitmapFont font;	
	
	SimpleVector2 pozycja;
	public FPSViewer(){
		
		font = AssetConsole.font12;		
		pozycja = new SimpleVector2(Gdx.graphics.getWidth() - 30, Gdx.graphics.getHeight() - 30);
	}	
	
	public void SetPosition(SimpleVector2 vPositionText){
		
		pozycja = vPositionText;
		
	}
	public void Draw(SpriteBatch batch){
		
		font.draw(batch, Integer.toString(Gdx.graphics.getFramesPerSecond()), Gdx.graphics.getWidth() - 30,  Gdx.graphics.getHeight() - 30);		
	}
	
	public void FullDraw(SpriteBatch batch){
		
		batch.begin();
		font.draw(batch, Integer.toString(Gdx.graphics.getFramesPerSecond()),pozycja.x ,pozycja.y );
		batch.end();
	}
}
